package com.ljk.dao.impl;

import com.ljk.dao.ExampleDao;
import org.springframework.stereotype.Repository;

/**
 * 数据访问层实现类
 * <p>
 * {@link Repository}（用于将数据访问层（DAO层）的类标识为 Spring 中的 Bean，其功能与 @Component 相同。）
 *
 * @author leng
 * @date 2020-06-19
 */
@Repository
public class ExampleDaoImpl implements ExampleDao {

    private String name;
    private String age;

    @Override
    public void add() {
        System.out.println("示例方法,Dao层的方法add被执行了");
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getAge() {
        return age;
    }

    public void setAge(String age) {
        this.age = age;
    }

    @Override
    public String toString() {
        return "PersonDaoImpl{" +
                "name='" + name + '\'' +
                ", age='" + age + '\'' +
                '}';
    }

    public ExampleDaoImpl() {
    }

    public ExampleDaoImpl(String name, String age) {
        this.name = name;
        this.age = age;
    }
}
